package 测试;

import java.util.*;

/**
 * Created by hest0 on 2017/7/11.
 */
public class Map排序的应用 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s = sc.nextLine().trim();

            HashMap<Character, Integer> hm = new HashMap<>();

            for (int i = 0; i < s.length(); i++) {
                char c = s.charAt(i);
                if (hm.containsKey(c)) {
                    hm.put(c, hm.get(c) + 1);
                } else {
                    hm.put(c, 1);
                }
            }

            ArrayList<Map.Entry<Character, Integer>> list = new ArrayList<>(hm.entrySet());
            Collections.sort(list, new Comparator<Map.Entry<Character, Integer>>() {
                @Override
                public int compare(Map.Entry<Character, Integer> o1, Map.Entry<Character, Integer> o2) {
                    return o1.getValue() < o2.getValue() ? -1 : 1;
                }
            });

            int lowTimes = list.get(0).getValue().intValue();
            for (int i = 0; i < list.size(); i++) {
                if (list.get(i).getValue().intValue() != lowTimes)
                    break;
                else {
                    String cs = String.valueOf(list.get(i).getKey().charValue());
                    s = s.replaceAll(cs, "");
                }
            }

            System.out.println(s);

        }
        sc.close();


    }
}
